﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Formsy.Common
{
    public class ControlBuilderHelper
    {
        /// <summary>
        /// Creates control id from it's type and it's label. 
        /// Strips whitespace and calls ToLower().
        /// 
        /// eg. A TextBox with label "First Name" will be textboxfirstname.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="label"></param>
        /// <returns></returns>
        public static string CreateId(string type, string label)
        {
            return (type + label).Flatten();
        }
    }
}
